package com.tian.controller;

import com.tian.common.CommonResult;
import com.tian.dto.SendCodeReqDto;
import com.tian.service.SendCodeService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * {@code @description:} 发送登录验证码 控制器
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-12-08 17:22
 * {@code @version:} 1.0
 */
@Slf4j
@RestController
@RequestMapping("/send")
@Api(tags = "发送短信 控制器")
public class SendMessageController {

   @Resource
   private SendCodeService sendCodeService;

    @PostMapping("/code")
    public CommonResult<String> sendCode(@RequestBody SendCodeReqDto sendCodeReqDto) {

        return sendCodeService.sendCode(sendCodeReqDto);
    }
}
